<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue生命周期函数</title>
    <script src="https://unpkg.com/vue@next"></script>
    <!-- 
        1.v-if是通过直接去除元素控制的
        2.v-show指令 style="display: none;" 通过style样式进行隐藏和显示
        3.
     -->
</head>
<body>
    <div id="root"></div>
    <script>
        // vue的生命周期函数
        const app = Vue.createApp({
            data() {
                return {
                    show: false,
                }
            },
            template: `
                <div v-if="show">Hello world</div>
                <div v-show="show">Hello world</div>
            `
        });
        const vm = app.mount('#root');
    </script>
</body>
</html>